import { Controller, Get, Param, Res } from '@nestjs/common';
import { ArchiveService } from './archive.service';
import { Response } from 'express';
import { ConfigService } from '../../config/config.service';

@Controller('archive')
export class ArchiveController {
  constructor(private readonly archiveService: ArchiveService,
              private readonly configService: ConfigService) {}

  @Get('/:id')
  get(@Param('id') id: string, @Res() res: Response) {
    const theme = this.configService.get('theme', 'default');
    res.render(`themes/${theme}/template/show_product`);
  }
}
